

package com.maoshi.shop.distribution.api.controller;

import com.maoshi.shop.distribution.comment.model.DistributionBasicSet;
import com.maoshi.shop.distribution.comment.service.DistributionBasicSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author lgh on 2019/04/01.
 */
@RestController
@RequestMapping("/p/distribution/distributionBasicSet")
@AllArgsConstructor
@Api(tags = "分销基本设置")
public class DistributionBasicController {


    private DistributionBasicSetService distributionBasicSetService;

	/**
	 * 获取信息(根据店铺)fi'l
	 */
	@GetMapping("/canDistribution")
	@ApiOperation(value = "分销开关是否开启", notes = "获取分销开关是否开启，0关闭 1开启")
	public ResponseEntity<Integer> info(){
		DistributionBasicSet distributionSet = distributionBasicSetService.getByShopId();
		return ResponseEntity.ok(distributionSet.getDistributionSwitch());
	}

}
